﻿<prism:FlyoutView
    x:Class="WinRT.SIP.UI.Views.NetworkSettingsFlyout"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WinRT.SIP.UI.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
    mc:Ignorable="d"
    prism:ViewModelLocator.AutoWireViewModel="True">

    <Grid VerticalAlignment="Stretch"
          Background="{StaticResource FlyoutBackground}">

        <!-- Root grid definition -->
        <Grid.RowDefinitions>
            <RowDefinition Height="80" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- Header area for panel -->
        <Grid Background="{StaticResource FlyoutHeaderBackground}" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <StackPanel Orientation="Horizontal" Grid.Column="0" Margin="40, 32, 17, 13">
                <Button x:Uid="CredentialsFlyoutBackButton"
                        Command="{Binding GoBackCommand}"
                        Margin="0,3,0,0"
                        Style="{StaticResource SettingsBackButtonStyle}"
                        AutomationProperties.AutomationId="CredentialsFlyoutBackButton" />
                <TextBlock
                    Margin="10,0,0,0"
                    FontFamily="Segoe UI"
                    FontWeight="SemiLight"
                    FontSize="24"
                    Text="Network Settings"
                    Width="225" />
            </StackPanel>
        </Grid>
        
        <!-- Settings Panel Content -->
        <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
            <Grid Margin="40,33,40,39" VerticalAlignment="Top" Grid.RowSpan="3">

                <StackPanel>
                    <StackPanel Margin="0,20,0,0">
                        <TextBlock x:Name="RealmLabel"
                                   x:Uid="RealmLabel"
                                   Text="Realm"
                                   Style="{StaticResource LightBasicTextStyle}" />
                        <TextBox
                            Text="{Binding Realm, Mode=TwoWay}"
                            AutomationProperties.AutomationId="RealmTextBox"
                            AutomationProperties.IsRequiredForForm="True"
                            AutomationProperties.LabeledBy="{Binding ElementName=ProxyHostLabel}"
                            Style="{StaticResource LightTextBoxStyle}" />
                    </StackPanel>
                    <StackPanel Margin="0,20,0,0">
                        <TextBlock x:Name="ProxyHostLabel"
                                   x:Uid="ProxyHostLabel"
                                   Text="Proxy Host"
                                   Style="{StaticResource LightBasicTextStyle}" />
                        <TextBox
                            Text="{Binding ProxyHost, Mode=TwoWay}"
                            AutomationProperties.AutomationId="ProxyHostTextBox"
                            AutomationProperties.IsRequiredForForm="True"
                            AutomationProperties.LabeledBy="{Binding ElementName=ProxyHostLabel}"
                            Style="{StaticResource LightTextBoxStyle}" />
                    </StackPanel>
                    <StackPanel Margin="0,20,0,0">
                        <TextBlock x:Name="ProxyPortLabel"
                                   x:Uid="ProxyPortLabel"
                                   Text="Proxy Port"
                                   Style="{StaticResource LightBasicTextStyle}" />
                        <TextBox
                            Text="{Binding ProxyPort, Mode=TwoWay}"
                            AutomationProperties.AutomationId="ProxyPortTextBox"
                            AutomationProperties.IsRequiredForForm="True"
                            AutomationProperties.LabeledBy="{Binding ElementName=ProxyPortLabel}"
                            Style="{StaticResource LightTextBoxStyle}" />
                    </StackPanel>
                    <StackPanel Margin="0,20,0,0">
                        <TextBlock x:Name="TransportLabel"
                                   x:Uid="TransportLabel"
                                   Text="Transport"
                                   Style="{StaticResource LightBasicTextStyle}" />
                        <ComboBox
                            ItemsSource="{Binding TransportProtocols}"
                            SelectedItem="{Binding Transport, Mode=TwoWay}"
                            HorizontalAlignment="Left"
                            Width="120"
                            AutomationProperties.AutomationId="TransportComboBox"
                            AutomationProperties.IsRequiredForForm="True"
                            AutomationProperties.LabeledBy="{Binding ElementName=TransportLabel}"
                            Style="{StaticResource LightComboBoxStyle}" />
                    </StackPanel>
                    <Button Margin="0,20,0,0" Content="Save" Style="{StaticResource LightButtonStyle}" Command="{Binding SaveCommand}" />
                </StackPanel>
            </Grid>
        </ScrollViewer>
    </Grid>

</prism:FlyoutView>
